package gcu.module.notice.controller;

import gcu.module.notice.daomain.Notice;
import gcu.module.notice.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by haol on 2016/9/29.
 */
@Controller
@RequestMapping("/notice")
public class NoticeController {
      @Autowired
      private NoticeService noticeService;

      @RequestMapping( value = "/add",method = RequestMethod.POST)
      public String add(String noticeStr){
            Notice notice = new Notice();
            notice.setNotice(noticeStr);
            noticeService.addNotice(notice);
            return "redirect:/user/wel";
      }
}
